package cs340.stormtroopers.hypeerweb;

import phase6.Command;
import phase6.GlobalObjectId;
import phase6.PeerCommunicator;
public class HyPeerWebProxy
    extends HyPeerWeb
{
    private GlobalObjectId globalObjectId;

    public HyPeerWebProxy(GlobalObjectId globalObjectId){
    	super(false);
        this.globalObjectId = globalObjectId;
    }

    public void clear(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "clear", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public boolean contains(cs340.stormtroopers.hypeerweb.Node p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "cs340.stormtroopers.hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "contains", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }

    public int size(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "size", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Integer)result;
    }

    public void close(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "close", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public static cs340.stormtroopers.hypeerweb.HyPeerWeb getSingleton(){
    	return null;
    }

    public boolean addNode(cs340.stormtroopers.hypeerweb.Node p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "cs340.stormtroopers.hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "addNode", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }

    public void addToHyPeerWeb(cs340.stormtroopers.hypeerweb.Node p0, cs340.stormtroopers.hypeerweb.Node p1){
        String[] parameterTypeNames = new String[2];
        parameterTypeNames[0] = "cs340.stormtroopers.hypeerweb.Node";
        parameterTypeNames[1] = "cs340.stormtroopers.hypeerweb.Node";
        Object[] actualParameters = new Object[2];
        actualParameters[0] = p0;
        actualParameters[1] = p1;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "addToHyPeerWeb", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public cs340.stormtroopers.hypeerweb.Node getRandomNode(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "getRandomNode", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (cs340.stormtroopers.hypeerweb.Node)result;
    }

    public boolean addAnotherNode(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "addAnotherNode", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        if(result instanceof Exception)
        {
        	((Exception) result).getCause().printStackTrace();
        }
        return (Boolean)result;
    }

    public void removeFromHyPeerWeb(cs340.stormtroopers.hypeerweb.Node p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "cs340.stormtroopers.hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "removeFromHyPeerWeb", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public void removeNodeByReference(int p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "int";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "removeNodeByReference", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public cs340.stormtroopers.database.HyPeerWebDatabase getHyPeerWebDatabase(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "getHyPeerWebDatabase", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (cs340.stormtroopers.database.HyPeerWebDatabase)result;
    }

    public void saveToDatabase(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "saveToDatabase", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public void remoteBroadCast(int p0, cs340.stormtroopers.hypeerweb.BroadcastVisitor p1, cs340.stormtroopers.hypeerweb.Parameters p2){
        String[] parameterTypeNames = new String[3];
        parameterTypeNames[0] = "int";
        parameterTypeNames[1] = "cs340.stormtroopers.hypeerweb.BroadcastVisitor";
        parameterTypeNames[2] = "cs340.stormtroopers.hypeerweb.Parameters";
        Object[] actualParameters = new Object[3];
        actualParameters[0] = p0;
        actualParameters[1] = p1;
        actualParameters[2] = p2;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "remoteBroadCast", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public boolean removeNode(cs340.stormtroopers.hypeerweb.Node p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "cs340.stormtroopers.hypeerweb.Node";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "removeNode", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }

    public cs340.stormtroopers.hypeerweb.Node getNode(int p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "int";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "getNode", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (cs340.stormtroopers.hypeerweb.Node)result;
    }

    public void reload(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "reload", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public void reload(java.lang.String p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "java.lang.String";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "reload", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public java.util.HashMap getNodeMap(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "getNodeMap", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (java.util.HashMap)result;
    }

    public void addGUI(gui.GUIFacade p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "gui.GUIFacade";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "addGUI", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public void removeGUI(gui.GUIFacade p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "gui.GUIFacade";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "removeGUI", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public void remoteSend(int p0, cs340.stormtroopers.hypeerweb.SendVisitor p1, cs340.stormtroopers.hypeerweb.Parameters p2){
        String[] parameterTypeNames = new String[3];
        parameterTypeNames[0] = "int";
        parameterTypeNames[1] = "cs340.stormtroopers.hypeerweb.SendVisitor";
        parameterTypeNames[2] = "cs340.stormtroopers.hypeerweb.Parameters";
        Object[] actualParameters = new Object[3];
        actualParameters[0] = p0;
        actualParameters[1] = p1;
        actualParameters[2] = p2;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "remoteSend", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }
    
    public void printToAllTracePanels(java.lang.String p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "java.lang.String";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "printToAllTracePanels", parameterTypeNames, actualParameters, false);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }

    public boolean equals(java.lang.Object p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "java.lang.Object";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "java.lang.Object", "equals", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }
    
    public void leaveSession(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "leaveSession", parameterTypeNames, actualParameters, true);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }


    public java.lang.String toString(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "cs340.stormtroopers.hypeerweb.HyPeerWeb", "toString", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (java.lang.String)result;
    }

    public int hashCode(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "java.lang.Object", "hashCode", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Integer)result;
    }

}
